<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>io: Module Index</title>
    <link rel="stylesheet" href="../luadoc.css" type="text/css" />
	<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
</head>

<body>
<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->

<div id="main">

<div id="navigation">


<h1>LuaDoc</h1>
<ul>
	
	<li><a href="../index.html">Index</a></li>
	
</ul>


<!-- Module list -->

<h1>Modules</h1>
<ul>

	<li>
		<a href="../modules/base.html">base</a>
	</li>

	<li>
		<a href="../modules/bin.html">bin</a>
	</li>

	<li>
		<a href="../modules/debug.html">debug</a>
	</li>

	<li>
		<a href="../modules/fstable.html">fstable</a>
	</li>

	<li>
		<a href="../modules/getopt.html">getopt</a>
	</li>

	<li><strong>io</strong></li>
	
	<li>
		<a href="../modules/lcs.html">lcs</a>
	</li>

	<li>
		<a href="../modules/list.html">list</a>
	</li>

	<li>
		<a href="../modules/math.html">math</a>
	</li>

	<li>
		<a href="../modules/mbox.html">mbox</a>
	</li>

	<li>
		<a href="../modules/object.html">object</a>
	</li>

	<li>
		<a href="../modules/package.html">package</a>
	</li>

	<li>
		<a href="../modules/parser.html">parser</a>
	</li>

	<li>
		<a href="../modules/set.html">set</a>
	</li>

	<li>
		<a href="../modules/std.html">std</a>
	</li>

	<li>
		<a href="../modules/strbuf.html">strbuf</a>
	</li>

	<li>
		<a href="../modules/string.html">string</a>
	</li>

	<li>
		<a href="../modules/table.html">table</a>
	</li>

	<li>
		<a href="../modules/tree.html">tree</a>
	</li>

</ul>



<!-- File list -->

<h1>Files</h1>
<ul>

	<li>
		<a href="../files/base.html">base.lua</a>
	</li>

	<li>
		<a href="../files/bin.html">bin.lua</a>
	</li>

	<li>
		<a href="../files/debug_ext.html">debug_ext.lua</a>
	</li>

	<li>
		<a href="../files/debug_init.html">debug_init.lua</a>
	</li>

	<li>
		<a href="../files/fstable.html">fstable.lua</a>
	</li>

	<li>
		<a href="../files/getopt.html">getopt.lua</a>
	</li>

	<li>
		<a href="../files/io_ext.html">io_ext.lua</a>
	</li>

	<li>
		<a href="../files/lcs.html">lcs.lua</a>
	</li>

	<li>
		<a href="../files/list.html">list.lua</a>
	</li>

	<li>
		<a href="../files/math_ext.html">math_ext.lua</a>
	</li>

	<li>
		<a href="../files/mbox.html">mbox.lua</a>
	</li>

	<li>
		<a href="../files/modules.html">modules.lua</a>
	</li>

	<li>
		<a href="../files/object.html">object.lua</a>
	</li>

	<li>
		<a href="../files/package_ext.html">package_ext.lua</a>
	</li>

	<li>
		<a href="../files/parser.html">parser.lua</a>
	</li>

	<li>
		<a href="../files/set.html">set.lua</a>
	</li>

	<li>
		<a href="../files/std.html">std.lua</a>
	</li>

	<li>
		<a href="../files/strbuf.html">strbuf.lua</a>
	</li>

	<li>
		<a href="../files/strict.html">strict.lua</a>
	</li>

	<li>
		<a href="../files/string_ext.html">string_ext.lua</a>
	</li>

	<li>
		<a href="../files/table_ext.html">table_ext.lua</a>
	</li>

	<li>
		<a href="../files/tree.html">tree.lua</a>
	</li>

	<li>
		<a href="../files/xml.html">xml.lua</a>
	</li>

</ul>






</div><!-- id="navigation" -->

<div id="content">

<h1>Module <code>io</code></h1>

<p>Additions to the io module</p>





<h2>Functions</h2>
<table class="function_list">

	<tr>
	<td class="name" nowrap><a href="#catdir">catdir</a>&nbsp;(...)</td>
	<td class="summary">Concatenate two or more directories into a path, removing the trailing slash.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#catfile">catfile</a>&nbsp;(...)</td>
	<td class="summary">Concatenate one or more directories and a filename into a path.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#processFiles">processFiles</a>&nbsp;(f)</td>
	<td class="summary">Process files specified on the command-line.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#readlines">readlines</a>&nbsp;(h)</td>
	<td class="summary">Read a file into a list of lines and close it.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#shell">shell</a>&nbsp;(c)</td>
	<td class="summary">Perform a shell command and return its output.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#splitdir">splitdir</a>&nbsp;(path)</td>
	<td class="summary">Split a directory path into components.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#writeline">writeline</a>&nbsp;(h, ...)</td>
	<td class="summary">Write values adding a newline after each.</td>
	</tr>

</table>






<br/>
<br/>



<h2><a name="functions"></a>Functions</h2>
<dl class="function">



<dt><a name="catdir"></a><strong>catdir</strong>&nbsp;(...)</dt>
<dd>
Concatenate two or more directories into a path, removing the trailing slash.


<h3>Parameters</h3>
<ul>
	
	<li>
	  ...: path components
	</li>
	
</ul>






<h3>Return value:</h3>
path



</dd>




<dt><a name="catfile"></a><strong>catfile</strong>&nbsp;(...)</dt>
<dd>
Concatenate one or more directories and a filename into a path.


<h3>Parameters</h3>
<ul>
	
	<li>
	  ...: path components
	</li>
	
</ul>






<h3>Return value:</h3>
path



</dd>




<dt><a name="processFiles"></a><strong>processFiles</strong>&nbsp;(f)</dt>
<dd>
Process files specified on the command-line. If no files given, process <code>io.stdin</code>; in list of files, <code>-</code> means <code>io.stdin</code>. <br>FIXME: Make the file list an argument to the function.


<h3>Parameters</h3>
<ul>
	
	<li>
	  f: function to process files with, which is passed <code>(name, arg_no)</code>
	</li>
	
</ul>








</dd>




<dt><a name="readlines"></a><strong>readlines</strong>&nbsp;(h)</dt>
<dd>
Read a file into a list of lines and close it.


<h3>Parameters</h3>
<ul>
	
	<li>
	  h: file handle or name (default: <code>io.input ()</code>)
	</li>
	
</ul>






<h3>Return value:</h3>
list of lines



</dd>




<dt><a name="shell"></a><strong>shell</strong>&nbsp;(c)</dt>
<dd>
Perform a shell command and return its output.


<h3>Parameters</h3>
<ul>
	
	<li>
	  c: command
	</li>
	
</ul>






<h3>Return value:</h3>
output, or nil if error



</dd>




<dt><a name="splitdir"></a><strong>splitdir</strong>&nbsp;(path)</dt>
<dd>
Split a directory path into components. Empty components are retained: the root directory becomes <code>{"", ""}</code>.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: path
	</li>
	
</ul>






<h3>Return value:</h3>
list of path components



</dd>




<dt><a name="writeline"></a><strong>writeline</strong>&nbsp;(h, ...)</dt>
<dd>
Write values adding a newline after each.


<h3>Parameters</h3>
<ul>
	
	<li>
	  h: file handle (default: <code>io.output ()</code>
	</li>
	
	<li>
	  ...: values to write (as for write)
	</li>
	
</ul>








</dd>


</dl>






</div> <!-- id="content" -->

</div> <!-- id="main" -->

<div id="about">
	<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->	
</body>
</html>
